#pragma once
#include "ILight.h"

class CSpotLight : public ILight
{
private:
	float m_cutOffAngle;
	float m_beamAngle;

	CVector3f m_direction;
	CVector3f m_location;

	CVector3f m_attenuation;

public:
	CSpotLight();
	CSpotLight(const CColor& color, const CVector3f& location, const CVector3f& direction, float cutOff,
		float beam, const CVector3f& attenuation);
	~CSpotLight();

	CColor computeColor(const CRay& ray, float dist)const;
	void computeShadowRay(const CVector3f& point, CRay& shadowRay, float* distance)const;
	void applyViewMatrix(const CMatrix& view);
};